/***************************************************************************
 * File name: IEPubDocument.h
 * Original author: caizhifei2003@163.com
 * Date: 2013.03.01
 ***************************************************************************/
#ifndef _I_EPUB_DOCUMENT_H_
#define _I_EPUB_DOCUMENT_H_

#include "EPubConfig.h"
#include "EPubBase.h"
#include "EPubDefinitions.h"
#include "EPubPointer.h"
#include "IEPubBuffer.h"
#include "IEPubBasic.h"
#include "IEPubMedia.h"

class IEPubDocument : public EPubBase
{
public:
	virtual EPUB_Result Load(const char *path) = 0;
	virtual EPUB_Result Save(const char *path) const = 0;

	virtual const EPubPointer<IEPubBuffer> GetFileBuffer(const char *href) const = 0;
	virtual const EPubPointer<IEPubBuffer> GetBasicFileBuffer(EPUB_BasicFileType basicFileType) const = 0;

	static EPubPointer<IEPubBasic> CreateBasicFile(EPUB_BasicFileType basicFileType);
	static EPubPointer<IEPubMedia> CreateMediaFile(EPUB_MediaFileType mediaFileType);

	static EPUB_MediaFileType ToMediaFileType(const char *mediaType);
	static const char *ToMediaType(EPUB_MediaFileType mediaFileType);
};

#endif // _I_EPUB_DOCUMENT_H_